﻿@{
    ViewBag.Title = "Thống kê giá chi tiết thiết kế theo kho";
}

<script type="text/javascript">
    $(document).ready(function () {
        $('#CheckValid').bootstrapValidator({
            message: 'This value is not valid',
            excluded: [':disabled'],
            feedbackIcons: {
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
            fields: {
                StockID: {
                    validators: {
                        notEmpty: {
                            message: 'Phải chọn kho'
                        }
                    }
                },
            }
        }).on('success.form.bv', function (e) {
            // Prevent form submission
            e.preventDefault();

            // Get the form instance
            var $form = $(e.target);

            // Get the BootstrapValidator instance
            var bv = $form.data('bootstrapValidator');
            // Use Ajax to submit form data
            $.ajax({
                type: "POST",
                url: '@Url.Action("PrintView", "PriceStore")',
                async: false,
                cache: false,
                data: { ID: $("#StockID").val() },
                success: function (result) {
                    $("#List").html(result);
                },
                error: function (xhr, ajaxOptions, thrownError) {
                    alert(xhr.status);
                    alert(xhr.responseText);
                    alert(thrownError);
                }
            });
        });
    });
</script>
<div id="breadcrumb">
    <div class="container">
        <div id="con_top">
            <div class="c_container">
                <h3>Thống kê sản phẩm nhập kho sau sản xuất</h3>
            </div>
        </div>
    </div>
</div>
<form class="form-horizontal" role="form" id="CheckValid" style="margin-top: 10px;">
    <div class="form-group">
        <label for="dtEfective" class="col-sm-3 control-label" style="margin-top:10px;">Chọn kho</label>
        <div class="col-sm-4" style="margin-top:10px;">
            <div>
                @Html.DropDownList("StockID", new SelectList(ViewData["Stock"] as IEnumerable<Data.Models.Stock>, "ID", "Name"), "Chọn mẫu", new { @class = "form-control" })
            </div>
            <div class="cleardiv"></div>
            <div class="btn-group">
                <button id="btnSaveSale" type="submit" class="btn btn-defaultxero">Xem báo cáo</button>
            </div>
            <div class="btn-group">
                <button id="btnCancelSale" type="button" onclick="javascript: location.href = '/PriceStore';" class="btn btn-defaultxero">Hủy</button>
            </div>
        </div>
    </div>
    <div class="form-group">
        <div id="List" class="col-sm-8 col-sm-offset-3">
        </div>
    </div>

</form>
